<?php
class U{
	static $tabPower;

	function U(){
		throw new Exception('call (final)class::__construct');
	}

	function id(){
		return $_SESSION['$admin_uid'];
	}
	function gid(){
		return $_SESSION['$admin_gid'];
	}
	function name(){
		return $_SESSION['$admin_name'];
	}

	function in(&$L){		
		$_SESSION['$admin_uid'] = $L['id'];
		$_SESSION['$admin_gid'] = $L['gid'];
		$_SESSION['$admin_name'] = $L['name'];
	}

	function out(){
		unset($_SESSION['$admin_uid']);
		unset($_SESSION['$admin_gid']);
		unset($_SESSION['$admin_name']);
	}



	function Power(){
		
		$power	= include( B_DIR . '/_res/power/' . self::id() . '.php');

		if( !($_GET['mod'] === '_admin' && $_GET['fun'] === 'login') ){
			$mod2	= include( B_DIR . '/_res/const/mod2.php');
			$key	= $_GET['mod'] . '.' . $_GET['fun'] . '.' . $_GET['act'];
			$key	= $mod2[$key];
			if( empty( $power[1][$key]) ){
				A::msg('你没有该操作的权限!', '', 60 , 60);
			}
			unset($mod2);
		}
		if( $power[2] ){
			self::$tabPower	=& $power[2];
		}
		unset($power);
	}
	



}
?>